#pragma once
#ifndef __LIT__CORE__COMPONENT__INCLUDED__HH__
#define __LIT__CORE__COMPONENT__INCLUDED__HH__

#include "LitPrerequisites.h"
#include "LitCoreComponentTypes.h"
#include "LitEnumStr.h"

namespace Lit
{
	class LIT_API CoreComponent
	{
	public:
		typedef CoreComponentType Type;

	protected:
		Type mType;

	public:
		CoreComponent(Type type);
		virtual ~CoreComponent();

		Type type() const;

		virtual void initialise(OgreRenderWindowPtr win, OgreCameraPtr cam, OgreSceneManagerPtr mgr );
		virtual bool renderOneFrame( float dt );
		virtual void shutdown();
	};
	

	class LIT_API CoreComponentList
	{
	public:
		typedef CoreComponent::Type Type;
		typedef std::vector<CoreComponent::Type> vec_t;
		typedef std::vector<CoreComponent::Type>::iterator itor_t;
		typedef std::vector<CoreComponent::Type>::const_iterator const_itor_t;
	protected:
		vec_t mTypes;

	public:
		CoreComponentList();
		CoreComponentList( Type type );
		CoreComponentList( const vec_t &types );
		CoreComponentList(const CoreComponentList& list);
		~CoreComponentList();
		
		// All Components List
		static CoreComponentList ALL;
		// No Components List
		static CoreComponentList NONE;

		itor_t begin(){ return mTypes.begin(); }
		itor_t end(){ return mTypes.end(); }
		const_itor_t begin() const{ return mTypes.begin(); }
		const_itor_t end() const{ return mTypes.end(); }

		void add( CoreComponent::Type comp );
		void remove( CoreComponent::Type comp );
		bool has( CoreComponent::Type component ) const;
		bool operator[]( CoreComponent::Type component ) const;
		CoreComponentList& operator << ( CoreComponent::Type type );

		std::vector<CoreComponent::Type>& types();
		const std::vector<CoreComponent::Type>& types() const;

		void reset();
	};
};

#endif